import { Snap } from 'leafer-x-snap';
export class SnapRender {
    static name = 'snap'
    constructor(app, options) {
        this.app = app
        this.snap = null
        this.options = options
    }
    init() {
        if (!this.options.snap) return
        // 尺子
        this.snap = new Snap(this.app, {
            snapSize: 5,
            strokeWidth: 2,
        });
        // 启用吸附功能
        this.snap.enable(true);
        return this
    }
    Cancel() {
        if (this.snap) this.snap.enable(false);
    }
}